package com.byxy.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.byxy.dao.TipDao;
import com.byxy.entity.Tip;
import com.byxy.service.TipService;

@Transactional
@Service
public class TipServiceImpl implements TipService {
	@Autowired
	private TipDao tipDao;

	public List<Tip> findAll() {
		return tipDao.findAll();
	}

	public Tip get(Integer forumId) {
		return tipDao.get(forumId);
	}

	public void add(String tipTitle, String tipContent, Integer tabId, Integer userId) {
		tipDao.add(tipTitle, tipContent, tabId, userId);
	}

	public void update(String tipTitle, Integer tabId, String tipContent, Integer tipId) {
	}

	public void changeTipStatus(Integer tipIsDeleted, Integer tipIsKnot, Integer tipId) {
		tipDao.changeTipStatus(tipIsDeleted, tipIsKnot, tipId);
	}

	@Override
	public List<Tip> findByPage(Integer pageNum, Integer pageSize) {
		return tipDao.findByPage(pageNum, pageSize);
	}
}
